
http://159.138.167.116:8979/csjiana/swagger-ui/index.html

// 服务器地址
const baseUrl =  "https://www.africagonepay.info";
// 服务器地址-旧版本
// "http://159.138.167.116:8979";
// "http://192.168.1.18:8979";

// 保存流水
const savePaymentBillsUrl = "/front/api/offline/saveOfflineBills";

// 保存短信
const saveOfflineSmsUrl = "/front/api/offline/saveOfflineSms";
// 保存短信-旧版本
// "/csjiana/api/savePaymentSms";

// 获取放款信息
const processTransferUrl = "/front/api/offline/processTransfer";

// 保存放款信息
const finishTransferUrl = "/front/api/offline/finishTransfer";

// 查询脚本状态
const getScriptInfoUrl = "/csjiana/api/getScriptInfo";

// 查询是否要上传流水-- 2024-12-02 新增 
const needUploadBillsUrl = "/front/api/offline/getBillFlag";

// ** 不用使用 **
const getLastSmsInfoUrl = "/front/api/offline/getLastSmsInfo";


const formatReqUrl = (path) => {
    let gPath = path || ""
    console.log(Constant.UI_SDK_VERSION + "gPath", gPath);
    if (!gPath.startsWith("/")) {
        gPath = "/" + gPath;
    }
    return baseUrl + gPath;
}

const saveBills = () => {
    return formatReqUrl(savePaymentBillsUrl);
}

const getLastSmsInfo = () => {
    return formatReqUrl(getLastSmsInfoUrl);
}

const saveSms = () => {
    return formatReqUrl(saveOfflineSmsUrl);
}

const getMtnTransferAccount = () => {
    return formatReqUrl(processTransferUrl);
}

const saveMtnTransferResult = () => {
    return formatReqUrl(finishTransferUrl);
}

const checkOperStatus = () => {
    return formatReqUrl(getScriptInfoUrl);
}

const checkNeedUploadBills = () => {
    return formatReqUrl(needUploadBillsUrl);
}

module.exports = {
    baseUrl: baseUrl,

    // 格式化请求地址
    formatReqUrl: formatReqUrl,

    // 保存流水
    saveBills: saveBills,

    // 最后一次保存短信信息
    getLastSmsInfo: getLastSmsInfo,

    // 保存短信
    saveSms: saveSms,

    // 获取mtn转账账号信息
    getMtnTransferAccount: getMtnTransferAccount,

    // mtn 转账完成
    saveMtnTransferResult: saveMtnTransferResult,

    // 查询脚本状态
    checkOperStatus: checkOperStatus,

    // 查询是否需要查流水
    checkNeedUploadBills: checkNeedUploadBills
};